﻿using System;
using System.Collections.Generic;
using NUnit.Framework;
using KKCai.HNKL.DAL;
using KKCai.HNKL.Model;

namespace KKCai.HNKL.Test
{
    [TestFixture]
    public class Helper
    {
        [Test]
        public void InitA1()
        {
            List<string> list = Utils.Get20P1();

            A1Dao dao = new A1Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new A1Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitA2()
        {
            List<string> list = Utils.Get20A2();

            A2Dao dao = new A2Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new A2Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitA3()
        {
            List<string> list = Utils.Get20A3();

            A3Dao dao = new A3Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new A3Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitP2()
        {
            List<string> list = Utils.Get20P2();

            P2Dao dao = new P2Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new P2Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitP3()
        {
            List<string> list = Utils.Get20P3();

            P3Dao dao = new P3Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new P3Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitN2()
        {
            List<string> list = Utils.Get20P2();

            N2Dao dao = new N2Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new N2Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitN3()
        {
            List<string> list = Utils.Get20P3();

            N3Dao dao = new N3Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new N3Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitN4()
        {
            List<string> list = Utils.Get20P4();

            N4Dao dao = new N4Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new N4Info() { Value = item });
            }

            dao.CommitTransaction();
        }

        [Test]
        public void InitN5()
        {
            List<string> list = Utils.Get20P5();

            N5Dao dao = new N5Dao();

            dao.BeginTransaction();

            foreach (string item in list)
            {
                dao.Save(new N5Info() { Value = item });
            }

            dao.CommitTransaction();
        }
    }
}
